<?php
/**
 * 队伍
 */
namespace app\sports\team\model;

use think\Db;
use think\Model;

class TeamModel extends Model
{

    private $database = 'sports_database';

    /**
     * 根据比赛ID获取比赛信息
     */
    public function getTeamInfo($teamId)
    {
        return Db::database($this->database)->table('foot_ball_team')->where('nami_team_id', $teamId)->find();
    }
    /*
     * 批量插入球队的信息
     * @$array 球员信息数组
     */
    public function insertTeamAll(array $array){
        return  Db::database($this->database)->table('foot_ball_team')->strict()->insertALL($array);
    }
    /*
     *获取全部球队的信息
     */
    public function getTeamInfos(){
        return Db::database($this->database)->table('foot_ball_team')->field('nami_team_id','name')->select();
    }
    /*
     * 通过球队的id获取球队的id
     */
    public function getTeamIdInfo(array $array){
       return Db::database($this->database)->table('foot_ball_team')->where('nami_team_id','in',$array)->field('nami_team_id')->select();
    }
}